package com.aaa.controller;

import com.aaa.entity.MyReturn;
import com.aaa.entity.Person;
import com.aaa.service.PersonService;
import com.fasterxml.jackson.databind.ser.Serializers;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/6/23 11:44
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("person")
public class PersonController extends BaseController {
    @Resource
    private PersonService personService;

    @GetMapping("findAllPerson.do")
    public MyReturn findAllPerson() {
        List<Person> allPerson = personService.findAllPerson();
        MyReturn myReturn = new MyReturn();
        myReturn.setData(allPerson);
        return super.getSuccessResult(myReturn);
    }
}
